package archsw0904.controller.shopping.cart;

public class CartBeanProxy implements archsw0904.controller.shopping.cart.CartBean {
  private String _endpoint = null;
  private archsw0904.controller.shopping.cart.CartBean cartBean = null;
  
  public CartBeanProxy() {
    _initCartBeanProxy();
  }
  
  public CartBeanProxy(String endpoint) {
    _endpoint = endpoint;
    _initCartBeanProxy();
  }
  
  private void _initCartBeanProxy() {
    try {
      cartBean = (new archsw0904.controller.shopping.cart.CartBeanServiceLocator()).getCartBeanPort();
      if (cartBean != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)cartBean)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)cartBean)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (cartBean != null)
      ((javax.xml.rpc.Stub)cartBean)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public archsw0904.controller.shopping.cart.CartBean getCartBean() {
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean;
  }
  
  public java.lang.Boolean addBook(java.lang.Integer arg0, java.lang.Integer arg1) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.addBook(arg0, arg1);
  }
  
  public java.lang.Integer addCopies(java.lang.Integer arg0, java.lang.Integer arg1, java.lang.Integer arg2) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.addCopies(arg0, arg1, arg2);
  }
  
  public java.lang.Integer createCart(java.lang.Integer arg0) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.createCart(arg0);
  }
  
  public archsw0904.controller.shopping.cart.BookListVisualizationInfo getBookList(java.lang.Integer arg0) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.getBookList(arg0);
  }
  
  public java.lang.Boolean removeBook(java.lang.Integer arg0, java.lang.Integer arg1) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.removeBook(arg0, arg1);
  }
  
  public java.lang.Boolean removeCopies(java.lang.Integer arg0, java.lang.Integer arg1, java.lang.Integer arg2) throws java.rmi.RemoteException, archsw0904.controller.shopping.cart.CartException{
    if (cartBean == null)
      _initCartBeanProxy();
    return cartBean.removeCopies(arg0, arg1, arg2);
  }
  
  
}